import http from "@/utils/request"

interface ILoginParams {
    loginname: string
    password: string
  }


export const login=(data:ILoginParams)=>{
    return http({
        url:"/user/login",
        method:"post",
        data
    }) as Promise<{ code: string; message: string; data?: any }>
}


export const reg=(data:ILoginParams)=>{
    return http({
        url:"/user/reg",
        method:"post",
        data
    }) as Promise<{ code: string; message: string; data?: any }>
}